<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var r = prompt('请输入圆的半径');
        alert('半径为' + r + '的圆的周长是' + getLong(r) + '\n面积是' + getArea(r));

        function getLong(r){
            return Math.PI * r * 2;
        }

        function getArea(r){
            return Math.PI * Math.pow(r,2);
        }

    </script>
</body>
</html>